package com.ycwl.freetv.receiver;

import android.content.BroadcastReceiver;
        import android.content.Context;
        import android.content.Intent;
        import android.content.pm.PackageInstaller;
        import android.util.Log;

public class InstallReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("InstallReceiver", "onReceive: " + intent.getIntExtra(PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_FAILURE));
        final int status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_FAILURE);
        if (status == PackageInstaller.STATUS_SUCCESS) {
            Log.d("InstallReceiver", "onReceive: true");
        } else {
            Log.d("InstallReceiver", "onReceive: false  " + status);
        }
    }
}
